package mBeanControl.interfacesImpl;

import javax.management.MBeanServerConnection;
import javax.management.ObjectName;

import mBeanControl.interfaces.IServerConfiguration;

public class ServerConfiguration implements IServerConfiguration{
	private MBeanServerConnection connection;
	private ObjectName serverMbean;
	
	public ServerConfiguration(MBeanServerConnection connection, ObjectName serverMbean) {
		this.connection = connection;
		this.serverMbean =  serverMbean;
	}

	public Integer getAcceptBacklog() {
		try {
			return (Integer) connection.getAttribute(serverMbean, "AcceptBacklog");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
	
}
